package com.xpresso.utils.unitTests.geo;

import uk.me.jstott.jcoord.LatLng;
import uk.me.jstott.jcoord.UTMRef;
import junit.framework.TestCase;

public class TestJcoord extends TestCase {

	public void testConversion(){
		// xalapa
		double lat = 19.5293;
		double lon = -97.0298;
		convert(lat, lon);
		
		// box: 
		// 19.788026283443592 19.270313471967903 -96.50802612304688 -97.33200073242188  
		lat = 19.788026283443592;
		lon = -96.50802612304688;
		convert(lat, lon);

		lat = 19.270313471967903;
		lon = -97.33200073242188;
		convert(lat, lon);		
		
	}

	private void convert(double lat, double lon) {
		LatLng point = new LatLng(lat, lon);
		UTMRef utmPoint = point.toUTMRef();
		System.out.println("UTM Zone: " + utmPoint.getLngZone() + " Easting: " 
				+ utmPoint.getEasting() + " Northing: " + utmPoint.getNorthing());
		System.out.println(utmPoint.getEasting() + " " + utmPoint.getNorthing());
	}
	
}
